///////////////////////////////////////////////////////////
//  EditCheckListCommand.cpp
//  Implementation of the Class EditCheckListCommand
//  Created on:      21-Sep-2013 12:07:21 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "EditCheckListCommand.h"
#include "CurrentCommand.h"

using namespace UI;
using namespace UI::CMD;

EditCheckListCommand::EditCheckListCommand(CCreateCheckListView* createCheckList, CCheckListView* checkListView)
{
  this->m_type = ICommand::EDITCHECKLIST_CMD;
  this->m_createCheckListView = createCheckList;
  this->m_checkListView = checkListView;
}


EditCheckListCommand::~EditCheckListCommand()
{

}


void EditCheckListCommand::Execute()
{
  this->m_createCheckListView->SetPage(dynamic_cast<IPage*>(this->m_checkListView->GetCurSelected()->Clone()));
  this->m_createCheckListView->Refresh();
  // Set current command
  CurrentCommand::GetInstance()->SetCurrentCommand(this->m_type);
  CurrentCommand::GetInstance()->SetNewOrEditCommand(this->m_type);
}


ICommand::CommandType EditCheckListCommand::GetType()
{

	return this->m_type;
}